<?php include_stylesheets_for_form($form) ?>
<?php include_javascripts_for_form($form) ?>

<form id="form_sistema" action="<?php echo url_for('sistema/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id_sistema='.$form->getObject()->getIdSistema() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
<input type="hidden" name="sf_method" value="put" />
<input type="hidden" name="id_sistema" value="<?php echo $form->getObject()->getIdSistema() ?>" />
<?php endif; ?>
	<?php echo $form->renderHiddenFields() ?>
  <table class="form">
    <tbody>
      <tr><th colspan="2" class="title">Dados sistema</th></tr>
      <?php echo $form->renderGlobalErrors() ?>
      <tr>
        <th><?php echo $form['id_sistema_pai']->renderLabel() ?></th>
        <td>
          <?php echo $form['id_sistema_pai'] ?>
          <?php echo form_error('sistema[id_sistema_pai]'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['nm_sistema']->renderLabel() ?></th>
        <td>
          <?php echo $form['nm_sistema'] ?>
          <?php echo form_error('sistema[nm_sistema]'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['ds_sobre']->renderLabel() ?></th>
        <td>
          <?php echo $form['ds_sobre'] ?>
          <?php echo form_error('sistema[ds_sobre]'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['ds_servico']->renderLabel() ?></th>
        <td>
          <?php echo $form['ds_servico'] ?>
          <?php echo form_error('sistema[ds_servico]'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['ds_twitter']->renderLabel() ?></th>
        <td>
          <?php echo $form['ds_twitter'] ?>
          <?php echo form_error('sistema[ds_twitter]'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['ds_facebook']->renderLabel() ?></th>
        <td>
          <?php echo $form['ds_facebook'] ?>
          <?php echo form_error('sistema[ds_facebook]'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['ds_youtube']->renderLabel() ?></th>
        <td>
          <?php echo $form['ds_youtube'] ?>
          <?php echo form_error('sistema[ds_youtube]'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['ds_flickr']->renderLabel() ?></th>
        <td>
          <?php echo $form['ds_flickr'] ?>
          <?php echo form_error('sistema[ds_flickr]'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['ds_orkut']->renderLabel() ?></th>
        <td>
          <?php echo $form['ds_orkut'] ?>
          <?php echo form_error('sistema[ds_orkut]'); ?>
        </td>
      </tr>
    </tbody>
  </table>
</form>

<?php
	comandos_form(
		link_to(
			':: Listar ::',
			'sistema/list',
			array('class' => 'btn btn-info')
		),
		button_to_function(
			':: Salvar ::',
			"$('#form_sistema').submit()",
			array('class' => 'btn btn-info')
		)
	);
?>